package cn.springcloud.fix.auth.api.feign.fallback;

import cn.springcloud.fix.auth.api.feign.RemoteAuthService;
import cn.springcloud.fix.auth.api.request.CheckPermissionRequest;
import cn.springcloud.fix.auth.api.response.CheckPermissionResponse;
import cn.springcloud.fix.common.core.base.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

@Slf4j
@Component
public class RemoteAuthServiceFallBack implements RemoteAuthService {

    @Override
    public R<String> hasPermission(String url, String method, String authentication) {
        log.info("服务不可用！");
        return R.ERROR();
    }

    @Override
    public R<String> hasPermission2(String url) {
        log.info("服务不可用！");
        return R.ERROR();
    }

    @Override
    public R<String> hasPermission3(Map<String, String> param) {
        log.info("服务不可用！");
        return R.ERROR();
    }

    @Override
    public CheckPermissionResponse checkPermission(CheckPermissionRequest request) {
        CheckPermissionResponse response = new CheckPermissionResponse();
        response.setCode(-1);
        response.setMessage("服务不可用!");
        return response;
    }
}
